home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
editor
/
batchstills.rexx
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
4KB
|
145 lines
/* BatchStills.rexx V2.0 -- Convert a Directory of framestores or IFF's */
/* or FrameStores into flyer Stills. */
/* By Bob Caron (Grue) © 1995 NewTek Inc. */
OPTIONS RESULTS
call remlib('PROJECT_REXX_PORT')
call remlib('ToasterARexx.port')
call remlib('rexxsupport.library')
call ADDLIB("rexxsupport.library", 0,-30,0)
call addlib('PROJECT_REXX_PORT', 0)
call addlib('ToasterARexx.port',0)
call set_view(2)
call req_error("Batch Stills V3.0 --- Convert a directory of framestores to flyer stills.")
call startfilereq("Location Of Framestores","toaster:framestore","(No Filename)")
exit=1
do while exit=1
file=queryfilereq()
if file=0 then call quit
if file~="" then exit=0
address command "c:wait 1"
end
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
call startfilereq("Save Stills To What Flyer Drive?","FA0:","(No Filename)")
exit=1
do while exit=1
fpath=queryfilereq()
if fpath=0 then call quit
if fpath~="" then exit=0
address command "c:wait 1"
end
if lastpos('/',fpath,length(fpath)-1)~=0 then do
filenam2=right(file,(length(fpath)-lastpos('/',fpath,length(fpath)-1)))
path2=left(fpath,(lastpos('/',fpath,length(fpath))-1))
end
else do
filenam2=right(fpath,(length(fpath)-lastpos(':',fpath,length(fpath)-1)))
path2=left(fpath,(lastpos(':',fpath,length(fpath))))
end
call pragma("D",path2)
fpath=pragma("D","RAM:")
if (right(fpath,1)~="/") & (right(fpath,1)~=":") then
fpath=fpath||"/"
if pragma('d',path||filenam)="" then file=path
else file=path||filenam
dir = showdir(path ,'f','*')
test=translate(dir,'?',' ','?')
test2=translate(test,' ','*',' ')
dir = test2
call req_error("Note: HQ-5 selection will only work if HQ-5 is turned on in the options panel.")
compression=-1
buttons='000'
do while compression=-1
buttons=req_buttons("Choose Compression:",buttons,"HQ-5","Standard","Extended")
if buttons="CANCEL" then call quit
if buttons="100" then do
compression=3
end
if buttons="010" then do
compression=0
end
if buttons="001" then do
compression=1
end
end
if req_tell("Still want to continue?")=0 then call quit
loopto=words(dir)
loop=1
call req_open("Working... Please Wait.")
badframes=0
do while (loop<loopto+1)
frame=translate(word(dir,loop),' ','?')
call req_error("Converting "||frame||"...")
if goodframe(path||"/"||frame)=1 then do
Switcher(MDV1)
Switcher(PDV1)
Switcher(LRGB,path||"/"||frame,0)
call req_close()
call req_open("Working... Please Wait.")
call req_error("Converting "||frame||"...")
call recordadd(fpath||frame,4,6,compression)
call makeicon(fpath||frame,1,STILL)
end
else badframes=badframes+1
loop=loop+1
end
call req_close()
if badframes>0 then call req_error("All done. (Note: "||badframes||" Non-IFF files were skipped.)")
if badframes=0 then call req_error("All done.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit
goodframe:
parse arg filename
if upper(right(filename,2))=".I" then do
badframes=badframes-1
return 0
end
return checkilbm(filename)
quit: PROCEDURE
call req_error("Canceled.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit
error:
/* ignore errors */
return
checkilbm:
parse arg file
if exists(file) then do
if open('infile',file,'READ') then do
filestart = readch('infile',12)
call close('infile')
if right(filestart,4)="ILBM" then return 1
end
end
return 0